//
//  BaseNoDataView.m
//  MianModule
//
//  Created by apple on 17/4/10.
//  Copyright © 2017年 FCY. All rights reserved.
//

#import "BaseNoDataView.h"
@interface BaseNoDataView()

@property (weak, nonatomic) IBOutlet UIImageView *noDataImageView;

@property (weak, nonatomic) IBOutlet UILabel *titleLabel;

@property (weak, nonatomic) IBOutlet UILabel *descLabel;

@property (weak, nonatomic) IBOutlet UIButton *optionButton;

@end

@implementation BaseNoDataView

+ (instancetype)noBaseNoDataWithType: (BaseNoDataType)type{
    
    NSBundle *_currentBundle = [NSBundle bundleForClass:self];
    
    BaseNoDataView *noDataView = [[_currentBundle loadNibNamed:@"BaseNoDataView" owner:nil options:nil] firstObject];
    
    NSString *bundleName = [[_currentBundle bundleIdentifier].pathExtension stringByAppendingString:@".bundle"];

    
    if (type == BaseNoDataStudents) {
        NSString *downLoadedPath = [_currentBundle pathForResource:@"noData_download.png" ofType:nil inDirectory:bundleName];
        noDataView.noDataImageView.image = [UIImage imageWithContentsOfFile:downLoadedPath];
        noDataView.titleLabel.text = @"还没有学生";
        noDataView.descLabel.text = @"添加学生以设置好您的班级";
        noDataView.optionButton.titleLabel.text = @"添加学生";
    }else if(type == BaseNoDataClasses)
    {
        NSString *downLoadedPath = [_currentBundle pathForResource:@"noData_downloading@3x.png" ofType:nil inDirectory:bundleName];
        noDataView.noDataImageView.image = [UIImage imageWithContentsOfFile:downLoadedPath];
        noDataView.titleLabel.text = @"还没有学生";
        noDataView.descLabel.text = @"添加学生以设置好您的班级";
        noDataView.optionButton.titleLabel.text = @"添加学生";
        
    }
    else if(type == BaseNoDataAffairs)
    {
        NSString *downLoadedPath = [_currentBundle pathForResource:@"noData_downloading@3x.png" ofType:nil inDirectory:bundleName];
        noDataView.noDataImageView.image = [UIImage imageWithContentsOfFile:downLoadedPath];
        noDataView.titleLabel.text = @"什么都没有？";
        noDataView.descLabel.text = @"拿起手机，拍拍身边的趣事";
        noDataView.optionButton.titleLabel.text = @"发布班务圈";
    }
    else if(type == BaseNoDataHomes)
    {
        NSString *downLoadedPath = [_currentBundle pathForResource:@"noData_downloading@3x.png" ofType:nil inDirectory:bundleName];
        noDataView.noDataImageView.image = [UIImage imageWithContentsOfFile:downLoadedPath];
        noDataView.titleLabel.text = @"还没有布置作业";
        noDataView.descLabel.text = @"学而时习之，不亦说乎";
        noDataView.optionButton.titleLabel.text = @"发布作业";
        
    }
    return noDataView;



}

//@property (nonatomic, copy) void(^clickBlock)();
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
